<h3><B>新鲜事管理</B></h3>

<a ng-click="gotoSpecialNewsAddPage()" class="btn-primary btn-sm nodecoration">新增新鲜事儿</a>

<div class="form-group" style="margin-top:50px">
    <label class="control-label" for="textinput">小区:</label>
    <select ng-model="communityId" ng-options="m.objId as m.communityName for m in communityLabelList.data"
            ng-change="getFreshNewsList(communityId)">
        <option value="">-- 请选择 --</option>
    </select>

    <a style="margin-left: 20px" ng-show="communityId !=null" class="btn-primary btn-sm nodecoration"
       ng-click="setOrder()">{{settingMessage}}</a>
    <a style="margin-left: 20px" ng-show="showSetting == true&&communityId !=null"
       class="btn-primary btn-sm nodecoration"
       ng-click="confirmOrder()">确定</a>
</div>

<div class="tab-content">
    <div class="tab-pane active" id="tab_a">
        <table class="table table-condensed">
            <thead>
            <tr>
                <th>小区</th>
                <th>类型</th>
                <th>标题</th>
                <th>链接</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="news in newsList">
                <td>
                    <div ng-repeat="c in news.community">
                        {{c.communityName}}
                    </div>
                </td>
                <td>{{news.tag}}</td>
                <td>{{news.title}}</td>
                <td>{{news.url}}</td>
                <td width="200">{{news.dateCreated | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                <td ng-show="showSetting == true&&communityId !=null">
                    <button class="btn-primary btn-sm nodecoration"
                            ng-click="upNews($index)">向上
                    </button>
                    <button class="btn-primary btn-sm nodecoration"
                            ng-click="downNews($index)">向下
                    </button>
                </td>
                <td ng-show="showSetting == false">
                    <a class="btn-danger btn-sm" ng-click="removeNews(news.objId)">删除</a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>